
import instance from "../utils/requests"
import path from "./base"

const api = {
    // 网络请求
    getUsers(){
        return instance.get(path.users)
    },
    login(user, pwd){
        return instance.post(path.login, {"username": user, "password": pwd})
    },
    // 获取目录树
    dirTree(base_dir){
        return instance.get(path.dirTree, {params: {base_dir: base_dir}})
    },
    // 提交表单对比
    commitFrom(data){
        // return instance.post(path.commitFrom, {data: data, headers: {'Content-Type': 'application/json'}})
        return instance.post(path.commitFrom, data)
    },
    // 获取配置文件内容
    getconfigfile(data){
        return instance.post(path.getconfigfile, data)
    },
    // 保存修改的配置文件
    commitconfigfile(code, pathArr){
        return instance.post(path.commitconfigfile, {"code": code, "path": pathArr})
    },
}

export default api